package com.mvvm.store.roombatabase;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.mvvm.store.bean.basebean.DeliveryScanInfoBean;
import com.mvvm.store.bean.basebean.StockUpScanInfoBean;

import java.util.List;

/**
 * 入库存储
 */

@Dao
public interface DeliveryScanDao {
    //查询所有的物料信息
    @Query("SELECT * FROM DeliveryScanInfoBean WHERE orderNumber=:orderNumber")
    List<DeliveryScanInfoBean> getAll(String orderNumber);

    //根据扫码的订单号查询对于的该订单信息
    @Query("SELECT * FROM DeliveryScanInfoBean WHERE oddNumber=:oddNumber")
    List<DeliveryScanInfoBean> getDeliveryScanByOddNumber(String oddNumber);

    //查询标签是否存在
    @Query("SELECT * FROM DeliveryScanInfoBean WHERE lableNumber=:lableNumber")
    List<DeliveryScanInfoBean> getDeliveryScanByLableNumber(String lableNumber);

    //新增扫码数据
    @Insert
    void insertAll(DeliveryScanInfoBean... deliveryScanInfoBeans);

    //修改单挑记录
    @Update
    void updateDeliveryScan(DeliveryScanInfoBean... users);


    //删除对于的备案数据
    @Delete
    void delete(DeliveryScanInfoBean user);


    //根据id查询对于的物料信息
    @Query("SELECT *FROM DeliveryScanInfoBean WHERE sId=:sId")
    List<DeliveryScanInfoBean> getDeliveryScanById(int sId);
}
